﻿// Decompiled with JetBrains decompiler
// Type: UnityEngine.Experimental.Rendering.ScriptableRuntimeReflectionSystemSettings
// Assembly: UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E6AE6B5A-2752-4B07-9528-C8B77C62CE79
// Assembly location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll
// XML documentation location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.xml

using System.Runtime.CompilerServices;
using UnityEngine.Bindings;
using UnityEngine.Scripting;

#nullable disable
namespace UnityEngine.Experimental.Rendering
{
  /// <summary>
  ///   <para>Global settings for the scriptable runtime reflection system.</para>
  /// </summary>
  [NativeHeader("Runtime/Camera/ScriptableRuntimeReflectionSystem.h")]
  [RequiredByNativeCode]
  public static class ScriptableRuntimeReflectionSystemSettings
  {
    private static ScriptableRuntimeReflectionSystemWrapper s_Instance = new ScriptableRuntimeReflectionSystemWrapper();

    /// <summary>
    ///   <para>The current scriptable runtime reflection system instance.</para>
    /// </summary>
    public static IScriptableRuntimeReflectionSystem system
    {
      get
      {
        return ScriptableRuntimeReflectionSystemSettings.Internal_ScriptableRuntimeReflectionSystemSettings_system;
      }
      set
      {
        if (value == null || value.Equals((object) null))
        {
          Debug.LogError((object) "'null' cannot be assigned to ScriptableRuntimeReflectionSystemSettings.system");
        }
        else
        {
          if (!(ScriptableRuntimeReflectionSystemSettings.system is BuiltinRuntimeReflectionSystem) && !(value is BuiltinRuntimeReflectionSystem) && ScriptableRuntimeReflectionSystemSettings.system != value)
            Debug.LogWarningFormat("ScriptableRuntimeReflectionSystemSettings.system is assigned more than once. Only a the last instance will be used. (Last instance {0}, New instance {1})", (object) ScriptableRuntimeReflectionSystemSettings.system, (object) value);
          ScriptableRuntimeReflectionSystemSettings.Internal_ScriptableRuntimeReflectionSystemSettings_system = value;
        }
      }
    }

    private static IScriptableRuntimeReflectionSystem Internal_ScriptableRuntimeReflectionSystemSettings_system
    {
      get => ScriptableRuntimeReflectionSystemSettings.s_Instance.implementation;
      [RequiredByNativeCode] set
      {
        if (ScriptableRuntimeReflectionSystemSettings.s_Instance.implementation != value && ScriptableRuntimeReflectionSystemSettings.s_Instance.implementation != null)
          ScriptableRuntimeReflectionSystemSettings.s_Instance.implementation.Dispose();
        ScriptableRuntimeReflectionSystemSettings.s_Instance.implementation = value;
      }
    }

    private static ScriptableRuntimeReflectionSystemWrapper Internal_ScriptableRuntimeReflectionSystemSettings_instance
    {
      [RequiredByNativeCode] get => ScriptableRuntimeReflectionSystemSettings.s_Instance;
    }

    [StaticAccessor("ScriptableRuntimeReflectionSystem", StaticAccessorType.DoubleColon)]
    [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterSceneLoad)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void ScriptingDirtyReflectionSystemInstance();
  }
}
